home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / cat3 / f90 / ieee_copy_sign.z / ieee_copy_sign
Text File  |  1998-10-30  |  3KB  |  87 lines

  1. IEEE_COPY_SIGN(3I)                                     Last changed: 1-6-98
  2.  
  3.  
  4. NNAAMMEE
  5.      IIEEEEEE__CCOOPPYY__SSIIGGNN - Returns _x with the sign of _y
  6.  
  7. SSYYNNOOPPSSIISS
  8.      IIEEEEEE__CCOOPPYY__SSIIGGNN (([XX==]_x,, [YY==]_y))
  9.  
  10. IIMMPPLLEEMMEENNTTAATTIIOONN
  11.      UNICOS/mk and IRIX systems
  12.  
  13.      CRAY T90 systems that support IEEE floating-point arithmetic
  14.  
  15. SSTTAANNDDAARRDDSS
  16.      CF90 and MIPSpro 7 Fortran 90 compiler extension to Fortran 90
  17.  
  18.      IEEE Standard for Binary Floating-point Arithmetic
  19.  
  20. DDEESSCCRRIIPPTTIIOONN
  21.      The IIEEEEEE__CCOOPPYY__SSIIGGNN intrinsic function returns _x with the sign of _y.
  22.      For example,
  23.      AABBSS((_x)) == IIEEEEEE__CCOOPPYY__SSIIGGNN((_x,, 11..00)) even if _x is a NaN.
  24.  
  25.      The Fortran 90 standard SSIIGGNN(3M) intrinsic function produces the same
  26.      result as IIEEEEEE__CCOOPPYY__SSIIGGNN on systems that support IEEE floating-point
  27.      arithmetic.
  28.  
  29.      This function accepts the following arguments:
  30.  
  31.      _x         Must be of type real.
  32.  
  33.      _y         Must be of type real.  If _x is a scalar, _y must be a scalar.
  34.                If _x is an array, _y can be scalar or an array of the same
  35.                shape as _x.
  36.  
  37.      IIEEEEEE__CCOOPPYY__SSIIGGNN is an elemental function.  The name of this intrinsic
  38.      cannot be passed as an argument.
  39.  
  40. NNOOTTEESS
  41.      The IEEE intrinsic procedures use the named constants contained in a
  42.      system module, so you must include one of the following statements in
  43.      your program:
  44.  
  45.      * On UNICOS and UNICOS/mk systems:  UUSSEE CCRRII__IIEEEEEE__DDEEFFIINNIITTIIOONNSS
  46.  
  47.      * On UNICOS, UNICOS/mk, and IRIX systems:  UUSSEE FFTTNN__IIEEEEEE__DDEEFFIINNIITTIIOONNSS
  48.  
  49.      The CCRRII__IIEEEEEE__DDEEFFIINNIITTIIOONNSS module is obsolescent.  It will be removed
  50.      for the CF90 4.0 release.
  51.  
  52. RREETTUURRNN VVAALLUUEESS
  53.      The return value is of the same type and type parameter as _x.  If _x is
  54.      an array, the result is an array of the same shape as _x.
  55.  
  56.      If _x is scalar, the result is a scalar that has the same value as _x
  57.      but with the sign of _y.
  58.  
  59.      If _x is an array and _y is scalar, the result is an array in which each
  60.      element has the value of the corresponding element of _x and the sign
  61.      of _y.
  62.  
  63.      If _x is an array and _y is an array, the result is an array in which
  64.      each element has the value of _x  but the sign of _y .
  65.                                     _i                  _i
  66. EEXXAAMMPPLLEESS
  67.      Example 1.  Each element of _x now has its original value but with the
  68.      sign of each corresponding element of _y:
  69.  
  70.           REAL   x(10), y(10)
  71.           ...                 ! Compute X and Y.
  72.           x = IEEE_COPY_SIGN(x, y)
  73.  
  74.      Example 2.  The following PRINT statement is executed on a system that
  75.      supports the IEEE standard for floating-point arithmetic:
  76.  
  77.           PRINT *, 'IEEE_COPY_SIGN(5.0,-0.0)
  78.  
  79.      The output of the preceding PRINT statement is -5.0.
  80.  
  81. SSEEEE AALLSSOO
  82.      SSIIGGNN(3M)
  83.  
  84.      _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, publication SR-2138, for the
  85.      printed version of this man page.
  86.  
  87.